#include<bits/stdc++.h>
using namespace std;
long long n, m, ans;
bool chk(long long k) {
    int s = 0;
    while (k) {
        s += k & 1;
        k >>= 1;
    }
    if (s == 1)return true;
    return false;
}
int main() {
    cin >> n;
    for (register int i = 1; i <= n; i++) {
        cin >> m;
        if (chk(m))ans++;
    }
    cout << ans;
}